<template>
  <div class="app-container">
    <div style="font-size:20px; margin-bottom: 50px;">
      <span>请刷卡入闸</span>
      <el-divider></el-divider>
    </div>
    <el-row :gutter="30">
      <!-- 身份证信息 -->
      <el-col :span="12">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>身份证信息</span>
          </div>
          <el-form ref="form" :model="form" label-width="120px">
            <el-form-item label="姓名">
              <el-input v-model="form.name" disabled></el-input>
            </el-form-item>

            <el-form-item label="身份证号码">
              <el-input v-model="form.idCard" disabled></el-input>
            </el-form-item>

            <el-form-item>
              <el-alert
                v-if="true"
                title="身份证读入成功"
                type="success"
                show-icon
              >
              </el-alert>

              <el-alert
                v-if="true"
                title="身份证读入失败"
                type="error"
                show-icon
              >
              </el-alert>
            </el-form-item>
          </el-form>
        </el-card>
      </el-col>
      <el-col :span="12">
        <!-- 运通卡信息 -->
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>PCC卡信息</span>
          </div>
           <el-form ref="form" :model="form" label-width="120px">
            <el-form-item label="PCC卡号">
              <el-input v-model="form.pccId" disabled></el-input>
            </el-form-item>

            <el-form-item label="nGen号">
              <el-input v-model="form.nGenId" disabled></el-input>
            </el-form-item>

            <el-form-item>
              <el-alert
                v-if="true"
                title="PCC卡读入成功"
                type="success"
                show-icon
              >
              </el-alert>

              <el-alert
                v-if="true"
                title="PCC卡读入失败"
                type="error"
                show-icon
              >
              </el-alert>
            </el-form-item>
          </el-form>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Tinymce from '@/components/Tinymce'
export default {
  components: { Tinymce },
  data() {
    return {
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: '',
      },
    }
  },
  created() {
    // TODO 在这里启动读卡线程 根据类型加载指定的读卡器
    /**
     * TODO 这里需要一个handle 处理各种异常信息提示 和服务器返回值
     *
     */
  },
  methods: {
    onSubmit() {
      console.log(this.form)
      this.$message('submit!')
    },
    onCancel() {
      this.$message({
        message: 'cancel!',
        type: 'warning',
      })
    },
  },
}
</script>

<style scoped>
.line {
  text-align: center;
}
</style>
